package edu.sctu.practice.class02.hujie.cgs.practice02.test02;

/**
 * Created by user14 on 2015/10/15.
 */
public class Vehicle {
    int speed;
    int size;

    //静态初始化
    public Vehicle(int speed, int size) {
        this.speed = speed;
        this.size = size;
        System.out.println("初试速度" + speed);
        System.out.println("初试体积" + size);
    }

    public void move() {
        System.out.println("他能跑就行！");
    }

    public int setSpeed(int speed) {
        return speed;
    }

    public int speedUp() {
        return 120;
    }

    public int speedDown() {
        return 60;
    }

    public static void main(String[] args) {
        Vehicle car = new Vehicle(13, 2);
        car.size = 1200;
        int speed = car.setSpeed(100);
        System.out.println("初始速度" + speed);
        System.out.println("car的体积" + car.size);
        System.out.println("加速后速度最大" + car.speedUp());
        System.out.println("加速后速度最小" + car.speedDown());
        car.move();
    }
}
